package com.xhwl.centiotdata.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xhwl.common.dto.cent.iotdata.repair.RepairActionDTO;
import com.xhwl.common.enums.iot.RepairResultEnum;
import com.xhwl.common.pojo.cent.iot.RepairOperateLog;
import com.xhwl.common.pojo.cent.sdata.Account;
import com.xhwl.common.query.cent.iotdata.RepairLogQuery;
import com.xhwl.common.vo.cent.iot.PageSimpleVO;

/**
 * Copyright (C),1998-2022, 兴海物联
 * FileName: RepairDetailLogService
 * Author: XuChang
 * Date: 2022/5/27 11:02
 * Description: 操作日志
 * History:
 */
public interface RepairOperateLogService extends IService<RepairOperateLog> {

    /**
     * 日志查询
     *
     * @param repairLogQuery
     * @return
     */
    PageSimpleVO<RepairOperateLog> operateLogQuery(RepairLogQuery repairLogQuery);

    /**
     * 初始化操作日志
     *
     * @param repairActionDTO
     * @return
     */
    RepairOperateLog initOperate(RepairActionDTO repairActionDTO, Account account);


    /**
     * 根据projectId和 type判断当前是否有正在执行的任务，有的话，等待
     *
     * @param repairActionDTO
     * @return
     */
    boolean isRepairInvoking(RepairActionDTO repairActionDTO);


    /**
     * 更新修复结果
     *
     * @param repairResultEnum
     * @param taskId
     */
    void updateOperateResult(RepairResultEnum repairResultEnum, Integer taskId);

    /**
     * 延迟多少秒后，检查该任务的完成详情
     *
     * @param second
     * @param taskId
     */
    void delayCheckTimeOut(long second, Integer taskId);

}
